<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center mediumagriculturaltools_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub mediumagriculturaltools_fd0_0'>
          <view class='flex flex-wrap align-center mediumagriculturaltools_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  mediumagriculturaltools_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='mediumagriculturaltools_fd0_0_c1_c0'>已缴纳押金</text>
          </view>
          <view class='flex flex-wrap align-center justify-end mediumagriculturaltools_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="text-red text-df resuse" v-if="dasta.status==4">{{dasta.refuse_reason}}</view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout mediumagriculturaltools_flex_1">
        <view class='flex flex-wrap align-center mediumagriculturaltools_fd1_0'>
          <text class='mediumagriculturaltools_fd1_0_c0'>已缴纳押金</text>
          <text class=' mediumagriculturaltools_fd1_0_c1'>
            <text class=' mediumagriculturaltools_price1_fd1_0_c1'>{{dasta.payable_money}}</text>
          </text>
          <text class='mediumagriculturaltools_fd1_0_c2'>元</text>
        </view>
        <text class='mediumagriculturaltools_fd1_1'>支付凭证</text>
        <view class="flex">
          <image class='mediumagriculturaltools_fd1_2' v-for="(item,index) in dasta.pay_images" :key="index"
            mode="aspectFill" :src='item'></image>
        </view>


        <view class='flex  mediumagriculturaltools_fd1_3'></view>

        <view class='flex flex-direction flex-wrap align-stretch mediumagriculturaltools_fd1_4'>
          <text class='mediumagriculturaltools_fd1_0_c0'>退还须知</text>
          <jyf-parser class='mediumagriculturaltools_fd1_4_c1' :html="dasta.return_back_note | richTextFormat">
          </jyf-parser>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view
        class="flex flex-wrap align-stretch justify-center benben-position-layout flex mediumagriculturaltools_flex_2">
        <button class='mediumagriculturaltools_fd2_0' @tap.stop="submit" data-type="navigateTo" v-if='dasta.status!=4'
          :data-url="`/pages/my/audit/audit?examine=2`">申请退押金</button>
        <button class='mediumagriculturaltools_fd2_0' @tap.stop="handleJumpDiy" data-type="redirectTo"
          v-if='dasta.status==4'
          :data-url="`/pages/my/farmTools/farmTools?id=${dasta.type}&price=${dasta.real_money}`">重新提交</button>
      </view>
      <view :style="{height: '120rpx'}"></view>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "dasta": {
          "bank_account": "",
          "bank_name": "",
          "bank_open": "",
          "big_pledge": "",
          "middle_pledge": "",
          "name": "",
          "pay_offline_images": "",
          "return_back_note": "",
          "small_pledge": ""
        },
        "id": "",
        "price": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        id,
        price
      } = options
      if (id !== undefined) this.id = id
      if (price !== undefined) this.price = price
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getPaymentFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      // getData(){
      //   this.$api.post(global.apiUrls.post63904efcaa202, {
      //     type:this.id
      //   }).then(res=>{
      //     if(res.data.code==1){
      //       this.info=res.data.data
      //     }
      //   })
      // },
      submit() {
        this.$api.post(global.apiUrls.post6538cdeacb19d, {
          type: this.id
        }).then(res => {
          if (res.data.code == 1) {
            this.$urouter.redirectTo(`/pages/my/audit/audit?examine=2`);
          }
        })
      },
      //获取线下支付
      async getPaymentFunc() {
        //请求方法
        //数据验证

        let datadasta = await this.$api.post(global.apiUrls.post6538cb148e024, {
          type: this.id
        });

        if (datadasta.data.code != 1) {
          this.$message.info(datadasta.data.msg);
          return
        }
        let infodasta = datadasta.data;
        this.dasta = infodasta.data
      }
    }
  };
</script>
<style lang="scss" scoped>
  .resuse {
    padding: 20rpx 0;
    text-align: center;
    background-color: rgba(229,77,66,0.1);
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .mediumagriculturaltools_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .mediumagriculturaltools_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
    line-height: 88rpx;
  }

  .mediumagriculturaltools_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .mediumagriculturaltools_fd0_0_c0 {
    width: 120rpx;
  }

  .mediumagriculturaltools_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .mediumagriculturaltools_flex_1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  ::v-deep .mediumagriculturaltools_fd1_4_c1 {
    width: 100%;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .mediumagriculturaltools_fd1_4 {
    margin: 0rpx 24rpx 0rpx 24rpx;
  }

  .mediumagriculturaltools_fd1_3 {
    background: rgba(238, 238, 238, 1);
    width: 702rpx;
    height: 1rpx;
    margin: 32rpx 0rpx 32rpx 24rpx;
    transform: scaleY(0.5);
  }

  .mediumagriculturaltools_fd1_2 {
    width: 200rpx;
    height: 200rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 24rpx 0rpx 0rpx 24rpx;
    border-radius: 16rpx;
  }

  .mediumagriculturaltools_fd1_1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
  }

  .mediumagriculturaltools_fd1_0_c2 {
    color: rgba(230, 56, 56, 1);
    font-size: 32rpx;
    font-weight: 500;
  }

  .mediumagriculturaltools_price1_fd1_0_c1 {
    font-size: 32rpx;
    color: rgba(230, 56, 56, 1);
    font-weight: 500;
  }

  .mediumagriculturaltools_fd1_0_c1 {
    color: #ff5536;
    font-weight: 600;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .mediumagriculturaltools_fd1_0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
  }

  .mediumagriculturaltools_fd1_0 {
    border-bottom: 1px solid #eee;
    margin: 0rpx 24rpx 32rpx 24rpx;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .mediumagriculturaltools_flex_2 {
    background: var(--benbenbgColor1);
    width: 750rpx;
    height: 120rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
  }

  .mediumagriculturaltools_fd2_0 {
    background: #E63838;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 702rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
  }
</style>
